<?php
/**
 * Created by PhpStorm.
 * User: coolinmind
 * Date: 14/01/2019
 * Time: 17:40
 */

namespace App\Services\Cargo;


use App\Services\ProjectValidate;

class ValidateCargo extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
    }

    /**
     * @var array 验证规则集合
     */
    public $rules = [
        'id'                => 'int|min:1',
        'user_id'           => 'required',
        'receiver_name'           => 'required',
        'receiver_phone'           => 'required',
        'type'           => 'required',
        'weight'           => 'required',
        'volume'           => 'required',
        'car_lenght'           => 'required',
        'car_type'           => 'required',
        'price'           => 'required',
        'loading_time'           => 'required',
        'page' => 'required|int',
        'addr' => 'required',
        'name' => 'required',
        'phone' => 'required',
        'status' => 'required',
        'money' => 'required',
        'pay_pass' => 'required',
        'pay_salt' => 'required',
        'deposit' => 'required'
    ];

    /**
     * @var array 当前验证错误信息
     */
    public $messages = [
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
        'id'   => 'ID',
    ];
}
